Core java - Interview Questions and Answers for 'Nagravision' - 3 question(s) found - Order By Newest Ans. The accessibility (public, protected, etc.) of the inner class is defined by the outer class.
Just like top-level classes, an inner class can extend a class or can implement interfaces.
Similarly, an inner class can be extended by other classes, and an inner interface can be implemented or extended by other classes or interfaces.
An inner class can be declared final or abstract.Inner classes can have inner classes, but you will have a hard time reading or understanding such complex nesting of classes. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   oops   classes   inner classes Asked in 2 Companies Basic   frequent Try 2 Question(s) TestRelated Questions Why do we need Inner classes ? Cant we just work with outer classes wherever we implement Inner classes ? What is the difference between the following two code lines ?
1. new OuterClass().new InnerClass();
2. new OuterClass.InnerClass(); What is the difference between inner class and sub class ? What are the different types of inner classes ? Which access specifier can be used with Class ? Difference between nested and inner classes ? Which of the following cannot be marked static ? Explain use of nested or inner classes ? What is the benefit of inner / nested classes ? Explain Static nested Classes ? Q2. What is a class and object ?
or
How would you explain a fresher the concept of class and object in simple terms ? Core Java
Ans. Class is a template using which objects are created in memory. It's kind of a mold using which objects with body / state are made.
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  class  object  class vs object Asked in 4 Companies basic   frequent Related Questions Difference between == and .equals() ? Why is String immutable in Java ? Explain the scenerios to choose between String , StringBuilder and StringBuffer ?
or
What is the difference between String , StringBuilder and StringBuffer ? Why Char array is preferred over String for storing password? What are different ways to create String Object? Explain. Why do we need Inner classes ? Cant we just work with outer classes wherever we implement Inner classes ? What are different ways of object creation in Java ? Differences between abstract class and interface ? What is a String Pool ? What are different types of classes ? Q3. How can we make objects if the constructor is private ? Core Java
This question was recently asked at 'Nagravision'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  constructor Asked in 1 Companies Related Questions What are the common uses of "this" keyword in java ? Can we use both "this()" and "super()" in a constructor ? Why every object constructor automatically call super() in Object before its own constructors? Can constructors be synchronized in Java ? Does Constructor creates the object ? What are constructors and Destructors in Java ? Are constructors inherited? Can a subclass call the parent's class constructor? When? Difference between object instantiation and construction ? How can we create objects if we make the constructor private ? Difference Between this() and super() ?